package oo.day04;

public class Test {
    public static void main(String[] args) {
        Person[]  people = new Person[8];
        people[0] = new Student("dqh",20,"重庆","2018060842XX");
        people[1] = new Student("sdf",21,"重庆","2018060842XX");
        people[2] = new Student("jk",22,"重庆","2018060842XX");
        people[3] = new Doctor("dbx",23,"山西","主持医生");
        people[4] = new Doctor("xyy",23,"电视","搞笑");
        people[5] = new Teacher("hw",30,"重庆",20000);
        people[6] = new Teacher("zls",30,"重庆",2000);
        people[7] = new Teacher("cls",30,"重庆",1000);
        for (int i = 0; i <people.length ; i++) {
            System.out.print(people[i].name+"--->");
            people[i].sayhi();
        }






    }
}
